﻿using DAL;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ViewModels;

namespace BLL
{
    public class BorrowBLL
    {
        BorrowDAL dal;//定义Borrow数据访问类对象
        public BorrowBLL()
        {
            dal = new BorrowDAL();
        }

        public MemoryStream GetStuPic(string stuID)
        {
            Guid id = Guid.Parse(stuID);//对传入的stuID进行Guid的转型
            return dal.GetStuPic(id);
        }
        public DataSet GetUserInfoByStuNo(string stuno)
        {
            return dal.GetUserInfoByStuNo(stuno);
        }
        public bool GetBookState(string bookid)
        {
            return dal.GetBookState(bookid);
        }
        public bool GetUserBorrowInfo(Guid stuid,string bookid)
        {
            // 前置条件：查询bookid对应书籍的借阅状态
            bool result = false;//默认借阅状态不可借
            if (GetBookState(bookid))
            {
                return result;
            }
            else
                return result;
        }
    }
}
